import type { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';

/**
 * @param name 路由名称, 必须设置,且不能重名
 * @param meta 路由元信息（路由附带扩展信息）
 * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
 * @param meta.disabled 禁用整个菜单
 * @param meta.title 菜单名称
 * @param meta.icon 菜单图标
 * @param meta.keepAlive 缓存该路由
 * @param meta.sort 排序越小越排前
 *
 */
const routes: Array<RouteRecordRaw> = [
  {
    path: '/base',
    name: 'Base',
    redirect: '/base/machine',
    component: Layout,
    meta: {
      title: 'base',
      sort: 1,
      icon: 'base',
    },
    children: [
      {
        path: 'color',
        name: 'Color',
        meta: {
          title: 'color',
        },
        component: () => import('@/views/permission/base/color/index.vue'),
      },
      {
        path: 'knife',
        name: 'Knife',
        meta: {
          title: 'knife',
        },
        component: () => import('@/views/permission/base/knife/index.vue'),
      },
      {
        path: 'plate',
        name: 'Plate',
        meta: {
          title: 'plate',
        },
        component: () => import('@/views/permission/base/plate/index.vue'),
      },
      {
        path: 'workType',
        name: 'WorkType',
        meta: {
          title: 'workType',
        },
        component: () => import('@/views/permission/base/workType/index.vue'),
      },
      {
        path: 'custom',
        name: 'Custom',
        meta: {
          title: 'custom',
        },
        component: () => import('@/views/permission/base/custom/index.vue'),
      },
      {
        path: 'shift',
        name: 'Shift',
        meta: {
          title: 'shift',
        },
        component: () => import('@/views/permission/base/shift/index.vue'),
      },
      {
        path: 'shift/add',
        name: 'ShiftAdd',
        meta: {
          title: 'shiftAdd',
          activeMenu: 'Shift',
        },
        component: () => import('@/views/permission/base/shift/add.vue'),
      },
      {
        path: 'shift/edit/:id',
        name: 'ShiftEdit',
        meta: {
          title: 'shiftEdit',
          activeMenu: 'Shift',
        },
        component: () => import('@/views/permission/base/shift/edit.vue'),
      },
      {
        path: 'machine',
        name: 'Machine',
        meta: {
          title: 'machine',
        },
        component: () => import('@/views/permission/base/machine/index.vue'),
      },
      {
        path: 'material',
        name: 'Material',
        meta: {
          title: 'material',
        },
        component: () => import('@/views/permission/base/material/index.vue'),
      },
      {
        path: 'shutdownReason',
        name: 'ShutdownReason',
        meta: {
          title: 'shutdownReason',
        },
        component: () => import('@/views/permission/base/shutdownReason/index.vue'),
      },
      {
        path: 'bad',
        name: 'Bad',
        meta: {
          title: 'bad',
        },
        component: () => import('@/views/permission/base/bad/index.vue'),
      },
      {
        path: 'maintainProject',
        name: 'MaintainProject',
        meta: {
          title: 'maintainProject',
        },
        component: () => import('@/views/permission/base/maintainProject/index.vue'),
      },
      {
        path: 'machineMaintainProject',
        name: 'MachineMaintainProject',
        meta: {
          title: 'machineMaintainProject',
        },
        component: () => import('@/views/permission/base/machineMaintainProject/index.vue'),
      },
      {
        path: 'machineMaintainProject/add',
        name: 'MachineMaintainProjectAdd',
        meta: {
          title: 'machineMaintainProjectAdd',
          activeMenu: 'MachineMaintainProject',
        },
        component: () => import('@/views/permission/base/machineMaintainProject/add.vue'),
      },
      {
        path: 'machineMaintainProject/edit/:id',
        name: 'MachineMaintainProjectEdit',
        meta: {
          title: 'machineMaintainProjectEdit',
          activeMenu: 'MachineMaintainProject',
        },
        component: () => import('@/views/permission/base/machineMaintainProject/edit.vue'),
      },
      {
        path: 'machineMaintainProject/check/:id',
        name: 'MachineMaintainProjectCheck',
        meta: {
          title: 'machineMaintainProjectCheck',
          activeMenu: 'MachineMaintainProject',
        },
        component: () => import('@/views/permission/base/machineMaintainProject/check.vue'),
      },
      {
        path: 'machineMaintainProject/copy/:id',
        name: 'MachineMaintainProjectCopy',
        meta: {
          title: 'machineMaintainProjectCopy',
          activeMenu: 'MachineMaintainProject',
        },
        component: () => import('@/views/permission/base/machineMaintainProject/copy.vue'),
      },
      {
        path: 'alarm',
        name: 'Alarm',
        meta: {
          title: 'alarm',
        },
        component: () => import('@/views/permission/base/alarm/index.vue'),
      },
    ],
  },
];

export default routes;
